package com.krzysztofadamczyk.dddex.customer;

import java.util.UUID;

import com.krzysztofadamczyk.dddex.domain.events.DomainEvents;
import com.krzysztofadamczyk.dddex.domain.model.Address;
import com.krzysztofadamczyk.dddex.domain.model.customer.Customer;
import com.krzysztofadamczyk.dddex.domain.model.customer.events.CustomerCreatedEvent;
import com.krzysztofadamczyk.dddex.domain.model.customergroup.CustomerGroup;

public class CustomerService {

    public void createCustomer(String name, Address address,
            CustomerGroup customerGroup) {

        Customer customer = new Customer(UUID.randomUUID()
                .getLeastSignificantBits());

        DomainEvents.publish(new CustomerCreatedEvent(customer));
    }
}
